home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Franz PD
/
Franz PD Disk #111 (1991-01)(Amiga User Group Deutschland e.V.).zip
/
Franz PD Disk #111 (1991-01)(Amiga User Group Deutschland e.V.).adf
/
Demos
/
Demo.asm
< prev
next >
Wrap
Assembly Source File
|
1989-07-03
|
4KB
|
139 lines
; Demo von E.Hambuch
; Handwarecodiert dank des Hardwarekurses im AMIGA-Magazin
; Freeware Bitte nicht verändern !
; Bitte Textdatei lesen !
; Quellcode für A68k-Assembler
CODE CHIP CHIP
MEMF_CLEAR: equ $10000
MEMF_PUBLIC: equ $1
MEMF_CHIP: equ $2
include 'startup.i' ;nur für Workbench-Start nötig
SCREEN_WIDTH: equ 320
SCREEN_HEIGHT: equ 256
EMPIRE_WIDTH: equ 288 ;Breite des Logos
EMPIRE_HEIGHT: equ 44 ;und Höhe
_main:
move.l 4,a6 ;Speicher für Bildschirm 2 Planes
move.l #SCREEN_WIDTH/8*SCREEN_HEIGHT*2,d0
move.l #MEMF_CLEAR!MEMF_PUBLIC!MEMF_CHIP,d1
jsr -198(a6) ;AllocMem
move.l d0,Memory
beq ende
move.l d0,d1 ;und in CopList eintragen
add.l #SCREEN_WIDTH/8*SCREEN_HEIGHT,d1
move.w d0,Plane0.1
swap d0
move.w d0,Plane0.0
move.w d1,Plane1.1
swap d1
move.w d1,Plane1.0
move.w #$4000,$dff09a ;Disable
move.l #CopList,$dff084 ;Copperliste aktivieren
move.w #0,$dff08a ;Copper-Strobe auslösen
;niemals mit CLR.W !!!!!
forever:
btst #6,$bfe001 ;Mausknopf ?
beq closeall
move.l $dff004,d0
and.l #$00013000,d0
cmp.l #$00013000,d0 ;auf Rasterzeile $130 warten
bne.s forever
move.w #%0000000100000000,Blitmode
lea Empire,a0 ;Löschen
move.l Memory,a1
bsr blit
lea Empire+(EMPIRE_WIDTH/8*EMPIRE_HEIGHT),a0
move.l Memory,a1
add.l #SCREEN_WIDTH/8*SCREEN_HEIGHT,a1
bsr blit
move.w #%0000100111110000,Blitmode
move.w RichtX,d0
add.w d0,XPos
move.w RichtY,d1
add.w d1,YPos
cmp.w #SCREEN_WIDTH-EMPIRE_WIDTH+16,XPos ;rechter Rand
bne.s w1
neg.w RichtX ;ja->Richtung unkehren
w1:
tst.w XPos ;linker Rand
bne.s w2
neg.w RichtX
w2:
cmp.w #SCREEN_HEIGHT-EMPIRE_HEIGHT,YPos ;unterer Rand
bne.s w3
neg.w RichtY
w3:
tst.w YPos
bne.s w4
neg.w RichtY
w4:
lea Empire,a0 ;und beide Planes an neue Position setzen
move.l Memory,a1
bsr blit
lea Empire+(EMPIRE_WIDTH/8*EMPIRE_HEIGHT),a0
move.l Memory,a1
add.l #SCREEN_WIDTH/8*SCREEN_HEIGHT,a1
bsr blit
bra forever
closeall:
move.w #$c000,$dff09a ;Enable
move.l Memory,a1 ;Speicher freigeben !!
move.l #SCREEN_WIDTH/8*SCREEN_HEIGHT*2,d0
move.l 4,a6
jsr -210(A6) ;FreeMem
ende: rts
blit:
btst #14,$dff002 ;auf Blitter warten
bne.s blit
clr.w $dff064 ;AMOD
move.w #(SCREEN_WIDTH-EMPIRE_WIDTH)/8,$dff066 ;DMOD
move.l #$ffff0000,$dff044 ;AMASK LEFT,RIGHT
moveq #0,d0
move.w XPos,d0
move.l d0,d1
and.w #$f,d0
ror.w #4,d0 ;Rechtsverschiebung um max. 15 Punkte
or.w Blitmode,d0
move.w d0,$dff040 ;in BLTCON0
clr.w $dff042 ;BLTCON1
lsr.w #3,d1 ;Anzahl der Bytes
bclr #0,d1
add.l d1,a1
move.w YPos,d1 ;YPosition
mulu #SCREEN_WIDTH/8,d1
add.l d1,a1
move.l a0,$dff050 ;APTH
move.l a1,$dff054 ;DPTH
move.w #EMPIRE_HEIGHT*64+(EMPIRE_WIDTH/16),$dff058 ;BLTSIZE und start
rts
Memory: ds.l 1
XPos: dc.w SCREEN_WIDTH/2-(EMPIRE_WIDTH/2) ;Zentriert
YPos: dc.w SCREEN_HEIGHT/2-(EMPIRE_HEIGHT/2)
RichtX: dc.w 1
RichtY: dc.w 1
Blitmode: ds.w 1
WAIT: macro
dc.w \1*$100|$f,-2
endm
COLOR: macro
dc.w $180,\1
endm
CopList:
dc.w $96,$20 ;Sprites off
dc.w $e0 ;Bitplanes
Plane0.0: dc.w 0,$e2
Plane0.1: dc.w 0,$e4
Plane1.0: dc.w 0,$e6
Plane1.1: dc.w 0
dc.w $8e,$3081,$90,$30c1,$92,$38,$94,$d0 ;320 x 256
dc.w $108,0,$10a,0 ;Moduli
dc.w $180,$000,$182,$ccc,$184,$888,$186,$f00 ;Colors
dc.w $100,%0010001000000000 ;LoRes 2 Planes
dc.l -2 ;End
xref Empire ;Bild LoRes 4 Farben malen der Größe wie oben
;angegeben und als Brush abspeichern. Mit Iff-Converter
;umwandeln und mit Dump2Hunk behandeln. Dann die Bilddatei
;dazulinken.
;nicht vergessen die Farben noch einzutragen (unter Colors)
end